<?php
Yii::app()->clientscript->scriptMap['/js/script-slider-p.js'] = false;
 $baseUrl = Yii::app()->baseUrl; 
	$cs = Yii::app()->getClientScript();	
	//$cs->registerScriptFile($baseUrl.'/js/jquery-1.10.1.min.js');
	$cs->registerScriptFile($baseUrl.'/js/jquery-1.9.0.min.js');
	$cs->registerScriptFile($baseUrl.'/js/jquery.nivo.slider2.js');
	$cs->registerScriptFile($baseUrl.'/js/script-slider-p.js');
	
	//Import CSS
	$cs->registerCssFile($baseUrl.'/css/nivo-slider.css');
	$cs->registerCssFile($baseUrl.'/css/default/default.css'); 
?>
<?php
	
	$model=StkCategoria::model()->findByPk($id);
	$model2=StkProducto::model()->findAll();
	$dataProvider=new CActiveDataProvider('StkProducto');
	$dataProvider = StkProducto::model()->findAll(array("condition"=>"Categoria_Id =  $id","order"=>"orden"));
?>
<div id="Description" class="content-inner2">
		<h1 class="tit-in">
			<?php echo $model->Nombre; ?>
		</h1>
		
		<div id="left-menu">
			<li>
				<?php
				$i=0;
				foreach($dataProvider as $data){?>
					
					<ul><?php 
							if($data->Estado!="E")
								echo CHtml::ajaxLink ($data->Nombre,
                              CController::createUrl('Productdetail',array('id'=>$data->Id)), 
                              array('update' => '#pro-content'),
							  $htmlOptions=array('id'=>'yf'.$model->Id.$i),
							  array('onclick'=>'$("#slider-in").prepend($("<div>").addClass("nivoSlider").offset({ top: 150, left: 500 }) )')
							   );
							   ?>
					</ul>
				<?php
					$i++;
				} ?>
			</li>
		</div>
		<div id="pro-content">
			<div id="pro-cont-txt">	
				<strong style="color:#fff; text-transform:uppercase;">
					Características
				</strong><br></br>
				<?php echo $dataProvider[0]->Texto; ?>
			</div>
			<div class="slider-wrapper theme-default">	
				<div id="slider-in" class="nivoSlider">
				<?php
				$criteria = new CDbCriteria;
				$criteria=array('condition'=>('Producto_Id=:id AND Estado!="E"'), 'params'=>array(':id'=>$dataProvider[0]->Id));
				$model = StkImagen::model()->findAll($criteria);
				
				?>
				<?php foreach($model as $iter){ ?>
				<img src="<?php echo "images/uploads/".$iter->Url; ?>" alt="" title="" />
				<?php } ?>
				<!--
					<img src="images/productos/foto5.jpg" alt="" title="" />
					<img src="images/productos/foto3.jpg" alt="" title="" />
					<img src="images/productos/foto1.jpg" alt="" title="" />
					<img src="images/productos/foto2.jpg" alt="" title="" />
					<img src="images/productos/foto4.jpg" alt="" title="" />-->
				</div>
			</div>
		</div>
	</div>